package inventario.carpeta1.action;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import inventario.util.Utilitario;

import inventario.carpeta1.model.Componente;
import java.util.List;

public class ListaComponenteAction {

	private List<Componente> componentes;
	
	public String execute(){
		String camino="success";
		EntityManager em= Utilitario.getInstance().getEntityManager();
		Query query=em.createQuery("Select o From Componente o");
		componentes=query.getResultList();
		return camino;
	}

	public List<Componente> getComponentes() {
		return componentes;
	}

	public void setComponentes(List<Componente> componentes) {
		this.componentes = componentes;
	}
	
}
